home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 17 / AACD 17.BIN / dists / potato / main / disks-m68k / 2.2.19-2000-12-03 / amiga / images-1.44 / rescue.bin / INSTALL.SH < prev    next >
Linux/UNIX/POSIX Shell Script  |  2000-11-29  |  1KB  |  60 lines

  1. #! /bin/sh
  2. #
  3. # Creates the  /boot  directory;
  4. # Installs the kernel image to the /boot directory and
  5. # makes necessary (sym-)links to the kernel.
  6. #
  7.  
  8. set -e
  9. umask 022
  10. VERSION=2.2.10
  11. readonly Arch=m68k
  12. if [ ! install.sh ]; then
  13.     echo 1>&2 "Error: Change directory to the boot disk before running this script."
  14.  
  15.     exit -1
  16. fi
  17. if [ $# -gt 0 ]; then
  18.     DDIR=$1
  19. fi
  20. if [ ! -d ${DDIR}/boot ]; then
  21.     mkdir -m 755 ${DDIR}/boot
  22. fi
  23. # Check for a pmac compressed kernel and copy/gunzip it.
  24. if [ -f linux.gz -a "$Arch" != "alpha" ]; then
  25.     zcat linux.gz > ${DDIR}/boot/vmlinux-${VERSION}
  26. else
  27.     cp linux ${DDIR}/boot/vmlinuz-${VERSION}
  28. fi
  29. if [ "$Arch" = "i386" ]; then
  30.     rdev ${DDIR}/boot/vmlinuz-${VERSION} ${DDIR}
  31.     rdev -r ${DDIR}/boot/vmlinuz-${VERSION} 0
  32.     rdev -R ${DDIR}/boot/vmlinuz-${VERSION} 1
  33.     rdev -v ${DDIR}/boot/vmlinuz-${VERSION} -1
  34. fi
  35. if [ -f sys_map.gz ]; then
  36.     zcat sys_map.gz > ${DDIR}/boot/System.map-${VERSION}
  37. fi
  38. if [ -f config.gz ]; then
  39.     zcat config.gz > ${DDIR}/boot/config-${VERSION}
  40. fi
  41. if [ -f ${DDIR}/vmlinuz ]; then 
  42.     rm -f ${DDIR}/vmlinuz.old
  43.     mv ${DDIR}/vmlinuz ${DDIR}/vmlinuz.old
  44.     rm -f ${DDIR}/vmlinuz
  45. fi
  46. (cd ${DDIR};
  47.  if [ -f boot/vmlinux-${VERSION} ]; then
  48.     ln -s boot/vmlinux-${VERSION} vmlinux
  49.  else
  50.     ln -s boot/vmlinuz-${VERSION} vmlinuz
  51.  fi)
  52. if [ -f ${DDIR}/boot/System.map ]; then 
  53.     rm -f ${DDIR}/boot/System.map
  54.     if [ -f ${DDIR}/boot/System.map-${VERSION} ]; then
  55.         cd ${DDIR}/boot && ln -s System.map-${VERSION} System.map
  56.     fi
  57. fi
  58. sync
  59. exit 0
  60.